﻿using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;
using System.Collections.Generic;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class GetRevisionsTest
    {
        private string accessToken;
        private List<FileMeta> fileMetaList;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            var client = new OAuth2Client(accessToken);
            fileMetaList = client.GetRevisions(StringConstants.SandboxRoot, "Test/Notes.txt");
        }

        [TestMethod]
        public void GetRevisions_ResultIsNotNull()
        {
            Assert.IsNotNull(fileMetaList);
        }

        [TestMethod]
        public void GetRevisions_HasRevisions()
        {
            Assert.IsTrue(fileMetaList.Any());
        }
    }
}
